import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.util.xmlb.XmlSerializerUtil

/**
 * 数据持久化存储
 *
 */
@Service
@State(name = "UIDemoState", storages = [Storage("ui-demo-state.xml")])
class UIDemoState: PersistentStateComponent<UIDemoState> {

    var address = "E:\\"

    override fun getState(): UIDemoState {
        return this
    }

    override fun loadState(state: UIDemoState) {
        XmlSerializerUtil.copyBean(state, this)
    }

}
